<?php

namespace app\web\model;

use think\Db;
use think\Model;

class NavModel extends Model
{

    // 设置数据表（不含前缀）
    protected $name = 'nav';

    public function __construct($data = [])
    {
        parent::__construct($data);
        $this->_collection = Db::name($this->name);
    }

    public function getNav()
    {
        $result = $this->_collection->where("status",1)->field("id,title,sort,status,url")->select();
        return $result;
    }
}